<template>
	<view class="list-user-product" v-if="list.length">
		<view class="user-product" v-for="(item, index) in list" :key="index" @click="goUrl('/pages/extends/user_product/detail?id='+item.id)">
			<view class="user-product-thumb">
				<image class="user-product-img" :src="item.thumb" mode="aspectFill" />
				<view class="user_product_label" v-if="item.type == 1"><image :src=" domain + '/uploads/default/20230717/1ac3fae9d7fa8d3717ce523395093bd8.png'" mode="widthFix"/></view>
				<view class="user_product_label" v-if="item.type == 0"><image :src=" domain + '/uploads/default/20230717/fa672abf3a579b329d0abd354aac8436.png'" mode="widthFix"/></view>
			</view>
			<view class="user-product-title line2">
				{{item.title}}
			</view>
			<view class="user-product-price">
				<text>¥</text>{{item.attr[0].price || 0.00}}
			</view>
		</view>
	</view>
</template>

<script>
	import { mapGetters } from "vuex";
	import { configMap } from '@/utils';
	import { HTTP_REQUEST_URL } from '@/config/app';
	export default {
		components: {
		},
		data() {
			return {
				domain: HTTP_REQUEST_URL,
			}
		},
		props: {
			list: {
				type: Array|Object,
				default: () => []
			},
			type: {
				type: Number,
				default: 1,
				value: 1,
			}
		},
		computed: configMap(['hide_mer_status'], mapGetters(['isLogin','viewColor','keyColor'])),
		created() {
		},
		methods: {
			goUrl(url) {
				this.$util.Tips(url);
			}
		}
	}
</script>

<style scoped lang="scss">
	.list-user-product {
		display: grid;
		grid-template-columns: repeat(2,1fr);
		grid-gap: 20rpx;
		.user-product {
			border-radius: 10rpx;
			background-color: #fff;
			.user-product-thumb {
				position: relative;
				border-radius: 10rpx 10rpx 0rpx 0rpx;
				.user-product-img {
					width: 100%;
					height: 440rpx;
					border-radius: 10rpx 10rpx 0rpx 0rpx;
				}
				.user_product_label {
					position: absolute;
					top: 0;
					left: 0;
					image {
						width: 83rpx;
					}
				}
			}
			.user-product-title {
				padding: 20rpx 20rpx 0;
				font-size: 28rpx;
				font-weight: 500;
				color: #313A40;
				line-height: 40rpx;
			}
			.user-product-price {
				padding: 30rpx 20rpx;
				font-size: 24rpx;
				font-weight: 600;
				color: #F50402;
				line-height: 28rpx;
				text {
					
				}
			}
		}
	}
</style>